/********************************************
*
*
*
*  test_log.c
*
*
********************************************/


#ifdef __cplusplus
 #if __cplusplus
  extern "C"{
 #endif
#endif /* __cplusplus */

#include "test_suite.h"
#include "d_log.h"


VOID TEST_LogInfoShow_001()
{
    UINT32 i;
    DMS_LogInfoClean(0);

    for( i = 0 ; i < 10; i++ )
    {
        DMS_LogInfo(i, "Log info test %d", i);
    }

    printf("\r\n=== 9 ===\r\n");
    DMS_LogInfoShow( 0 , 0 , 0, 1, 0);

    printf("\r\n=== 8 9 ===\r\n");
    DMS_LogInfoShow( 0 , 0 , 1, 2, 0);

    printf("\r\n=== 7 8 ===\r\n");
    DMS_LogInfoShow( 0 , 0 , 2, 2, 0);

    printf("\r\n=== 8 ===\r\n");
    DMS_LogInfoShow( 0 , 0 , 1, 1, 0);

    printf("\r\n=== 8 9 ===\r\n");
    DMS_LogInfoShow( 0 , 0 , 1, 0, 0);

    printf("\r\n=== 0 ~ 9  ===\r\n");
    DMS_LogInfoShow( 0 , 0 , 0, 0, 0);

    printf("\r\n=== 0 ~ 9  ===\r\n");
    DMS_LogInfoShow( 0 , 0 , 100, 100, 0);

}

VOID TEST_LogInfoShow_002()
{
    UINT32 i;

    for( i = 0 ; i < 10; i++ )
    {
        DMS_LogInfo(i, "Log info test %d", i);
    }

    for( i = 0 ; i < 10; i++ )
    {
        DMS_LogWarning(i,"Log warning test %d", i);
    }

    for( i = 0 ; i < 10; i++ )
    {
        DMS_LogError(i, "Log error test %d", i);
    }

    for( i = 0 ; i < 10; i++ )
    {
        DMS_LogExcept(i, "Log except test %d", i);
    }
}

void TEST_suite_Log(void)
{
    CU_pSuite suite;
    suite = CU_add_suite(__FUNCTION__, NULL, NULL);

    CU_ADD_TEST(suite, TEST_LogInfoShow_001);
    CU_ADD_TEST(suite, TEST_LogInfoShow_002);
}

#ifdef __cplusplus
 #if __cplusplus
  }
 #endif
#endif /* __cplusplus */

